<?php 


$files_rout = glob('./Upload/*');

if($_GET){
$files = $files_rout[$_GET['id']];
// var_dump($fileName);
// $file="./Upload/2016-04-11/robots.txt";

header("Content-type:application/octet-stream");

//二进制文件
$fileName = basename($files);

//获得文件名  
header("Content-Disposition:attachment;filename={$fileName}");
//下载窗口中显示的文件名
header("Accept-ranges:bytes");
//文件尺寸单位  
header("Accept-length:".filesize($files));
//文件大小  
readfile($files);
//读出文件内容
		$message = "下载成功";
 	   include './tpl/success.html';
}else{
	 $error = "下载失败";
 	   include './tpl/error.html';
}




 ?>